import http from "@/api";
import { ResPage } from "@/api/interface";
import {
  ApiSysRoleCreate,
  ApiSysRoleDelete,
  ApiSysRoleGetTree,
  ApiSysRoleGetTreeSelect,
  ApiSysRoleSearch,
  ApiSysRoleUpdate
} from "@/api/apis/sys_role";
import { ReqSearch } from "@/api/interface/Search/ReqSearch";
import { dtoSysRoleCreate, dtoSysRoleDelete, dtoSysRoleInfo, dtoSysRoleUpdate } from "@/api/dbdto/dtoSysRole";

export const requestSysRoleCreate = (params: dtoSysRoleCreate) => {
  return http.post(ApiSysRoleCreate, params);
};

export const requestSysRoleSearch = (params: ReqSearch) => {
  return http.post<ResPage<dtoSysRoleInfo>>(ApiSysRoleSearch, params);
};

export const requestSysRoleUpdate = (params: dtoSysRoleUpdate) => {
  return http.post(ApiSysRoleUpdate, params);
};

export const requestSysRoleDelete = (params: dtoSysRoleDelete) => {
  return http.post(ApiSysRoleDelete, params);
};

export const requestGetRoleTreeList = (params: dtoSysRoleDelete) => {
  return http.post(ApiSysRoleGetTree, params);
};
export const requestGetRoleTreeSelect = () => {
  return http.post(ApiSysRoleGetTreeSelect, {});
};
